﻿@{
    Layout = "~/Views/Shared/_LayoutForEUI.cshtml";
    var listColumns = ViewBag.Columns as List<SGArchiveSystem7x.Models.CColumnsModel>;
}
<table id="ArchiveTree_ArchiveFields_grid" class="easyui-datagrid" style="width:100%;" title="@ViewBag.Text0 (@ViewBag.Title)" data-options="
       rownumbers:true,
       singleSelect:true,
       autoRowHeight:false,
       pagination:false,
       fitColumns:true,
       fit:false,
       striped:true,
       checkOnSelect:false,
       selectOnCheck:false,
       toolbar:'#ArchiveTee_ArchiveFields_tb',
       collapsible:false">
    <thead frozen="true">
        <tr>
            @{foreach (var c in listColumns)
                {
                    if (c.Frozen)
                    {
                        <th field="@c.FieldValue" width="@c.Len" align="center" formatter="@c.Formate">@c.FieldText</th>
                    }

                }
            }
        </tr>
    </thead>
    <thead>
        <tr>
            @{foreach (var c in listColumns)
                {
                    if (!c.Frozen)
                    {
                        <th field="@c.FieldValue" width="@c.Len" align="center" formatter="@c.Formate">@c.FieldText</th>
                    }

                }
            }
        </tr>
    </thead>
</table>
<div id="ArchiveTee_ArchiveFields_tb" style="padding:2px 5px;">
    <table style="width:100%">
        <tr>
            <td>
                <a href="javascript:void(0);" class="easyui-linkbutton button-blue" iconCls="icon-add" onclick="AddArchiveFields(0)" style="width:110px;height:30px;">@ViewBag.Text1</a>
            </td>
            <td align="right">
                <a href="javascript:void(0);" class="easyui-linkbutton button-blue" iconCls="icon-add" onclick="AddArchiveTree(0)" style="width:110px;height:30px;">@ViewBag.Text2</a>
                <a href="javascript:void(0);" class="easyui-linkbutton button-blue" iconCls="icon-edit" onclick="ModifyArchiveTree(0)" style="width:110px;height:30px;">@ViewBag.Text3</a>
                <a href="javascript:void(0);" class="easyui-linkbutton button-blue" iconCls="icon-ok" onclick="AddArchiveType(0)" style="width:110px;height:30px;display:none">添加物品大类</a>
            </td>
        </tr>
    </table>
</div>
<div>
    <div id="ArchiveTree_ArchiveFields_winContent" class="easyui-window" title="@ViewBag.Text4" data-options="modal:true,closed:true,iconCls:'icon-save'" minimizable="false" maximizable="false" resizable="false" collapsible="false"
         style="width:400px;height:500px;padding:10px">
        <div class="easyui-layout" data-options="fit:true">
            <div data-options="region:'center'" style="padding:10px;border:0px">
                <div style="padding-bottom:10px">
                    <input class="easyui-textbox" id="ArchiveTree_ArchiveFields_txtName" label="@ViewBag.Text5" labelwidth="80px" labelalign="right" style="width:100%" data-options="required:true" />
                </div>
                <div style="padding-bottom:10px;display:none">
                    <select class="easyui-combobox" id="ArchiveTree_ArchiveFields_cmbType" label="@ViewBag.Text6" labelwidth="80px" labelalign="right" style="width:100%" editable="false" panelHeight="auto">
                        @{ 
                            if(SGArchiveSystem7x.Models.Language._nowLanguage == SGArchiveSystem7xDB._VersionLanguage._Chs)
                            {
                                <option value="文本">文本</option>
                                <option value="数字">数字</option>
                                <option value="日期">日期</option>
                                <option value="年份">年份</option>
                                <option value="部门">部门</option>
                                <option value="词典">词典</option>
                            }
                            else
                            {
                                 <option value="Text">Text</option>
                                 <option value="Number">Number</option>
                                <option value="Date">Date</option>
                                <option value="Year">Year</option>
                                <!--
                                <option value="部门">部门</option>
                                <option value="词典">词典</option>
                                    -->
                            }
                        }
                        
                    </select>
                </div>
                <div style="padding-bottom:10px;display:none">
                    <select class="easyui-combobox" id="ArchiveTree_ArchiveFields_cmbWordType" label="对应词典:" labelwidth="80px" labelalign="right" style="width:100%" editable="false" panelHeight="auto">
                        @{
                        var wordtypes = ViewBag.WordType as List
                        <SGArchiveSystem7x.Models.CComboboxModel>
                            ;
                            foreach(var word in wordtypes)
                            {
                            <option value="@word.ID">@word.Text</option>
                            }
                            }
                    </select>
                </div>
                <div style="padding-bottom:10px">
                    <select class="easyui-combobox" id="ArchiveTree_ArchiveFields_cmbShow" label="@ViewBag.Text7" labelwidth="80px" labelalign="right" style="width:100%" editable="false" panelHeight="auto">
                        <option value="0">@ViewBag.Text19</option>
                        <option value="1">@ViewBag.Text18</option>
                    </select>
                </div>
                <div style="padding-bottom:10px">
                    <select class="easyui-combobox" id="ArchiveTree_ArchiveFields_cmbQuery" label="@ViewBag.Text8" labelwidth="80px" labelalign="right" style="width:100%" editable="false" panelHeight="auto">
                        <option value="0">@ViewBag.Text19</option>
                        <option value="1">@ViewBag.Text18</option>
                    </select>
                </div>
                <div style="padding-bottom:10px;display:none">
                    <select class="easyui-combobox" id="ArchiveTree_ArchiveFields_cmbEdit" label="@ViewBag.Text9" labelwidth="80px" labelalign="right" style="width:100%" editable="false" panelHeight="auto">
                        <option value="0">否</option>
                        <option value="1" selected="selected">是</option>
                    </select>
                </div>
                <div style="padding-bottom:10px;display:none">
                    <select class="easyui-combobox" id="ArchiveTree_ArchiveFields_cmbStat" label="是否统计:" labelwidth="80px" labelalign="right" style="width:100%" editable="false" panelHeight="auto">
                        <option value="0">否</option>
                        <option value="1">是</option>
                    </select>
                </div>
                <div style="padding-bottom:10px;display:none">
                    <select class="easyui-combobox" id="ArchiveTree_ArchiveFields_cmbNull" label="可否为空:" labelwidth="80px" labelalign="right" style="width:100%" editable="false" panelHeight="auto">
                        <option value="0">否</option>
                        <option value="1">是</option>
                    </select>
                </div>
                <div style="padding-bottom:10px">
                    <input class="easyui-textbox" id="ArchiveTree_ArchiveFields_txtLen" label="@ViewBag.Text10" labelwidth="80px" labelalign="right" style="width:100%" data-options="required:true" />
                </div>
                <div style="padding-bottom:10px">
                    <input class="easyui-textbox" id="ArchiveTree_ArchiveFields_txtOrder" label="@ViewBag.Text11" labelwidth="80px" labelalign="right" style="width:100%" data-options="required:true" />
                </div>
            </div>
            <div data-options="region:'south',border:false" style="text-align:right;padding:0px,0,0;">
                <a class="easyui-linkbutton button-blue" data-options="iconCls:'icon-ok'" href="javascript:void(0)" style="width:100px" onclick="Save()" id="ArchiveTree_ArchiveFields_Add">@ViewBag.Text12</a>
                <a class="easyui-linkbutton button-blue" data-options="iconCls:'icon-ok'" href="javascript:void(0)" style="width:100px" onclick="Modify()" id="ArchiveTree_ArchiveFields_Modify">@ViewBag.Text13</a>
                <a class="easyui-linkbutton button-orange" data-options="iconCls:'icon-cancel'" href="javascript:void(0)" style="width:100px;display:none" onclick="closeWin()">@ViewBag.Text14</a>
            </div>
        </div>
    </div>
    <div id="ArchiveTree_ArchiveFields_winTree" class="easyui-window" title="@ViewBag.Text15" data-options="modal:true,closed:true,iconCls:'icon-save'" minimizable="false" maximizable="false" resizable="false" collapsible="false"
         style="width:400px;height:250px;padding:10px">
        <div class="easyui-layout" data-options="fit:true">
            <div data-options="region:'center'" style="padding:10px;border:0px">
                <div style="padding-bottom:10px">
                    <select id="ArchiveTree_ArchiveFields_cmbArchiveType" class="easyui-combobox" label="@ViewBag.Text16" labelwidth="80px" labelalign="right" style="width:100%" editable="false" panelHeight="auto">
                        @{
                            var listAType = ViewBag.ArchieType as List<SGArchiveSystem7xDB.T_ArchiveType>;
                            foreach(var n in listAType)
                            {
                                <option value="@n.ATYPE_ID">@n.ATYPE_NAME</option>
                            }
                        }
                    </select>
                </div>
                <div style="padding-bottom:10px">
                    <input class="easyui-textbox" id="ArchiveTree_ArchiveFields_ArchiveTreeName" label="@ViewBag.Text17" labelwidth="80px" labelalign="right" style="width:100%" data-options="required:true" />
                </div>
            </div>
            <div data-options="region:'south',border:false" style="text-align:right;padding:0px,0,0;">
                <a class="easyui-linkbutton button-blue" data-options="iconCls:'icon-ok'" href="javascript:void(0)" style="width:100px" onclick="SaveArchiveTree()" id="ArchiveTree_ArchiveFields_AddTree">@ViewBag.Text12</a>
                <a class="easyui-linkbutton button-blue" data-options="iconCls:'icon-ok'" href="javascript:void(0)" style="width:100px" onclick="Show_ModifyArchiveTree()" id="ArchiveTree_ArchiveFields_ModifyTree">@ViewBag.Text13</a>
                <a class="easyui-linkbutton button-orange" data-options="iconCls:'icon-cancel'" href="javascript:void(0)" style="width:100px;display:none" onclick="closeWinTree()">@ViewBag.Text14</a>
            </div>
        </div>
    </div>
    <div id="ArchiveTree_ArchiveFields_winType" class="easyui-window" title="@ViewBag.Text15" data-options="modal:true,closed:true,iconCls:'icon-save'" minimizable="false" maximizable="false" resizable="false" collapsible="false"
         style="width:400px;height:180px;padding:10px">
        <div class="easyui-layout" data-options="fit:true">
            <div data-options="region:'center'" style="padding:10px;border:0px">
                <div style="padding-bottom:10px">
                    <input class="easyui-textbox" id="ArchiveTree_ArchiveFields_ArchiveTypeName" label="@ViewBag.Text17" labelwidth="80px" labelalign="right" style="width:100%" data-options="required:true" />
                </div>
            </div>
            <div data-options="region:'south',border:false" style="text-align:right;padding:0px,0,0;">
                <a class="easyui-linkbutton button-blue" data-options="iconCls:'icon-ok'" href="javascript:void(0)" style="width:100px" onclick="SaveArchiveType()" id="ArchiveTree_ArchiveFields_AddType">@ViewBag.Text12</a>
                <a class="easyui-linkbutton button-blue" data-options="iconCls:'icon-ok'" href="javascript:void(0)" style="width:100px" onclick="ModifyArchiveType()" id="ArchiveTree_ArchiveFields_ModifyType">@ViewBag.Text13</a>
                <a class="easyui-linkbutton button-orange" data-options="iconCls:'icon-cancel'" href="javascript:void(0)" style="width:100px" onclick="closeWinType()">@ViewBag.Text14</a>
            </div>
        </div>
    </div>
</div>
 <script>
     var words =  @Html.Raw(Json.Encode(wordtypes));
     var nowid = 0;
    $(document).ready(function () {
        $('#ArchiveTree_ArchiveFields_grid').datagrid({
            url: '/ArchvieTree/Get_ajaxArchiveFields?arid=' + @ViewBag.ARID,
            singleSelect: true,
            method: 'post',
            onLoadSuccess: function (data) {
                $('.pagination-page-list').hide();
            }
        });

        $('#ArchiveTree_ArchiveFields_cmbType').combobox({
            onChange: function () {
                type = $("#ArchiveTree_ArchiveFields_cmbType").combobox("getValue");
                if (type == '@ViewBag.Text30')
                    $('#ArchiveTree_ArchiveFields_cmbWordType').combobox({ disabled: false });
                else
                    $('#ArchiveTree_ArchiveFields_cmbWordType').combobox({ disabled: true });
            },
        })
    });

    function formatStatus(value, row) {
        if (value == 1)
            return "<span style='color:blue'>" + '@ViewBag.Text18' + "</span>";
        else
            return "<span style='color:red'>" + '@ViewBag.Text19' + "</span>";
     }

     function closeWin() {
         $('#ArchiveTree_ArchiveFields_cmbWordType').combobox({ disabled: false });
         $('#ArchiveTree_ArchiveFields_cmbType').combobox({ disabled: false });
         $('#ArchiveTree_ArchiveFields_winContent').window('close');
     }

     function formatEdit(value, row) {
         return "<a href='javascript:void(0)' onclick='GetArchiveFields(" + value + ")'><img src='../Content/images/pencil.png' width='16px' height='16px' />&nbsp;" + '@ViewBag.Text20' + "</a>";
     }

     function formatWord(value, row) {
         if (value == 0)
             return "";
         else {
             for (var i = 0; i < words.length; i++) {
                 if (words[i].ID == value)
                     return "<span>" + words[i].Text + "</span>";
             }
         }
     }

     function AddArchiveType() {

         document.getElementById('ArchiveTree_ArchiveFields_AddType').style.display = '';
         document.getElementById('ArchiveTree_ArchiveFields_ModifyType').style.display = 'none';

         $('#ArchiveTree_ArchiveFields_ArchiveTypeName').textbox('setValue', '');

         $('#ArchiveTree_ArchiveFields_winType').window('open');
     }

     function AddArchiveTree() {
         document.getElementById('ArchiveTree_ArchiveFields_AddTree').style.display = '';
         document.getElementById('ArchiveTree_ArchiveFields_ModifyTree').style.display = 'none';

         $('#ArchiveTree_ArchiveFields_ArchiveTreeeName').textbox('setValue', '');

         $('#ArchiveTree_ArchiveFields_winTree').window('open');
     }

     function SaveArchiveType() {
         //Save_ajaxArchiveType
         var name = $('#ArchiveTree_ArchiveFields_ArchiveTypeName').val();
         if (name == '')
             $.messager.alert('@ViewBag.Text21', '@ViewBag.Text22', 'error');
         else {
             $.ajax({
                 url: "/ArchvieTree/Save_ajaxArchiveType",
                 dataType: "text",
                 type: "post",
                 data: { id: 0, name: name },
                 success: function (data) {
                     if (data == '0')
                         $.messager.alert('@ViewBag.Text21', '@ViewBag.Text23', 'error');
                     else if (data == '-1')
                         $.messager.alert('@ViewBag.Text21', '@ViewBag.Text24', 'error');
                     else {
                         ///刷新主页面
                             window.opener.location.reload();
                          }
                 }
             });
         }
     }

     function SaveArchiveTree() {
         var typeid = $('#ArchiveTree_ArchiveFields_cmbArchiveType').combobox('getValue');
         var name = $('#ArchiveTree_ArchiveFields_ArchiveTreeName').val();
         if (name == '')
             $.messager.alert('@ViewBag.Text21', '@ViewBag.Text22', 'error');
         else {
             $.ajax({
                 url: "/ArchvieTree/Save_ajaxArchiveTree",
                 dataType: "text",
                 type: "post",
                 data: { id: 0,typeid: typeid, name: name },
                 success: function (data) {
                     if (data == '0')
                         $.messager.alert('@ViewBag.Text21', '@ViewBag.Text23', 'error');
                     else if (data == '-1')
                         $.messager.alert('@ViewBag.Text21', '@ViewBag.Text24', 'error');
                     else {
                         ///刷新主页面
                         window.parent.location.reload();
                     }
                 }
             });
         }
     }

     function ModifyArchiveType() {
         document.getElementById('ArchiveTree_ArchiveFields_Add').style.display = '';
         document.getElementById('ArchiveTree_ArchiveFields_Modify').style.display = 'none';

         $('#ArchiveTree_ArchiveFields_winType').window('open');
     }

     function ModifyArchiveTree() {
         document.getElementById('ArchiveTree_ArchiveFields_AddTree').style.display = 'none';
         document.getElementById('ArchiveTree_ArchiveFields_ModifyTree').style.display = '';

         var name = '@ViewBag.Title';

         $('#ArchiveTree_ArchiveFields_ArchiveTreeName').textbox('setValue', name);
         $('#ArchiveTree_ArchiveFields_winTree').window('open');
     }

     function Show_ModifyArchiveTree() {
         var id = @ViewBag.ARID;
         var typeid = $('#ArchiveTree_ArchiveFields_cmbArchiveType').combobox('getValue');
         var name = $('#ArchiveTree_ArchiveFields_ArchiveTreeName').val();
         if (name == '')
             $.messager.alert('@ViewBag.Text21', '@ViewBag.Text22', 'error');
         else {
             $.ajax({
                 url: "/ArchvieTree/Save_ajaxArchiveTree",
                 dataType: "text",
                 type: "post",
                 data: { id: id, typeid: typeid, name: name },
                 success: function (data) {
                     if (data == '0')
                         $.messager.alert('@ViewBag.Text21', '@ViewBag.Text23', 'error');
                     else if (data == '-1')
                         $.messager.alert('@ViewBag.Text21', '@ViewBag.Text24', 'error');
                     else {
                         ///刷新主页面
                         window.parent.location.reload();
                     }
                 }
             });
         }
     }

     function closeArchiveType() {
         $('#ArchiveTree_ArchiveFields_ArchiveTypeName').textbox('setValue', '');
         $('#ArchiveTree_ArchiveFields_winType').window('close');
     }

     function closeArchiveTree() {
         $('#ArchiveTree_ArchiveFields_ArchiveTreeName').textbox('setValue', '');
         $('#ArchiveTree_ArchiveFields_winTree').window('close');
     }

     function GetArchiveFields(id) {
          $.ajax({
              url: "/ArchvieTree/Get_ajaxArchiveFieldsSingle",
                dataType: "json",
                type: "post",
                data: { id: id },
              success: function (data) {
                  nowid = id;

                  $('#ArchiveTree_ArchiveFields_txtName').textbox('setValue', data.en.AF_NAME);
                  $('#ArchiveTree_ArchiveFields_cmbType').combobox('setValue', data.en.AF_TYPE);
                  $('#ArchiveTree_ArchiveFields_cmbShow').combobox('setValue', data.en.AF_SHOW);
                  $('#ArchiveTree_ArchiveFields_cmbQuery').combobox('setValue', data.en.AF_QUERY);
                  $('#ArchiveTree_ArchiveFields_cmbEdit').combobox('setValue', data.en.AF_EDIT);
                  $('#ArchiveTree_ArchiveFields_cmbStat').combobox('setValue', data.en.AF_STAT);
                  $('#ArchiveTree_ArchiveFields_cmbNull').combobox('setValue', data.en.AF_ISNULL);
                  $('#ArchiveTree_ArchiveFields_txtLen').textbox('setValue', data.en.AF_LEN);
                  $('#ArchiveTree_ArchiveFields_txtOrder').textbox('setValue', data.en.AF_ORDER);

                  ////修改时，字段类型和词典类型不允许修改
                  $('#ArchiveTree_ArchiveFields_cmbWordType').combobox('setValue', data.en.AF_WORDID);
                  $('#ArchiveTree_ArchiveFields_cmbWordType').combobox({ disabled: true });
                  $('#ArchiveTree_ArchiveFields_cmbType').combobox({ disabled: true });

                  document.getElementById('ArchiveTree_ArchiveFields_Add').style.display = 'none';
                  document.getElementById('ArchiveTree_ArchiveFields_Modify').style.display = '';
                   $('#ArchiveTree_ArchiveFields_winContent').window('open');
                }
        });
     }

     function Vaild() {
         var len = $('#ArchiveTree_ArchiveFields_txtLen').val();
         var order = $('#ArchiveTree_ArchiveFields_txtOrder').val();
         if (isNaN(len)) {
             $.messager.alert("@ViewBag.Text21", '@ViewBag.Text25');
             return false;
         }
         else if (isNaN(order)) {
             $.messager.alert("@ViewBag.Text21", '@ViewBag.Text25');
             return false;
         }
         return true;
     }

     function AddArchiveFields() {
         $('#ArchiveTree_ArchiveFields_txtName').textbox('setValue', '');
         $('#ArchiveTree_ArchiveFields_cmbType').combobox('setValue', '@ViewBag.Text26');
         $('#ArchiveTree_ArchiveFields_cmbShow').combobox('setValue', 0);
         $('#ArchiveTree_ArchiveFields_cmbQuery').combobox('setValue', 0);
         $('#ArchiveTree_ArchiveFields_cmbEdit').combobox('setValue', 0);
         $('#ArchiveTree_ArchiveFields_cmbStat').combobox('setValue', 0);
         $('#ArchiveTree_ArchiveFields_cmbNull').combobox('setValue', 0);
         $('#ArchiveTree_ArchiveFields_txtLen').textbox('setValue', 50);
         //$('#statusId').combobox('disable');
         $('#ArchiveTree_ArchiveFields_cmbWordType').combobox({ disable: true });
         var data = $('#ArchiveTree_ArchiveFields_grid').datagrid('getData');
         var len = data.rows.length + 1;
         $('#ArchiveTree_ArchiveFields_txtOrder').textbox('setValue', len);

         document.getElementById('ArchiveTree_ArchiveFields_Add').style.display = '';
         document.getElementById('ArchiveTree_ArchiveFields_Modify').style.display = 'none';

         $('#ArchiveTree_ArchiveFields_winContent').window('open');
     }

     function Modify() {
         var aid = @ViewBag.ARID;

         var name = $('#ArchiveTree_ArchiveFields_txtName').val();
         var type = $('#ArchiveTree_ArchiveFields_cmbType').combobox('getValue');
         var wordid = $('#ArchiveTree_ArchiveFields_cmbWordType').combobox('getValue');
         if (type != '词典')
             wordid = 0;
         var show = $('#ArchiveTree_ArchiveFields_cmbShow').combobox('getValue');
         var query = $('#ArchiveTree_ArchiveFields_cmbQuery').combobox('getValue');
         var edit = $('#ArchiveTree_ArchiveFields_cmbEdit').combobox('getValue');
         var stat = $('#ArchiveTree_ArchiveFields_cmbStat').combobox('getValue');
         var isnull = $('#ArchiveTree_ArchiveFields_cmbNull').combobox('getValue');
         var len = $('#ArchiveTree_ArchiveFields_txtLen').val();
         var order = $('#ArchiveTree_ArchiveFields_txtOrder').val();
         if (!Vaild())
             return;

         $.ajax({
                url: "/ArchvieTree/Save_ajaxArchiveFields",
                dataType: "text",
                type: "post",
                data: { aid: aid, name: name, type: type, wordid: wordid, show: show, query: query, edit: edit, stat: stat, isnull: isnull, len: len, order: order, id:nowid},
                success: function (data) {
                    if (data == -1)
                        $.messager.alert('@ViewBag.Text21', '@ViewBag.Text24', 'error');
                    else if (data == 0)
                        $.messager.alert('@ViewBag.Text21', '@ViewBag.Text27', 'error');
                    else {
                        $.messager.alert('@ViewBag.Text21', '@ViewBag.Text28', 'info');
                        $('#ArchiveTree_ArchiveFields_winContent').window('close');
                        $('#ArchiveTree_ArchiveFields_grid').datagrid({
                            url: '/ArchvieTree/Get_ajaxArchiveFields?arid=' + aid,
                            singleSelect: true,
                            method: 'post',
                            onLoadSuccess: function (data) {
                                $('.pagination-page-list').hide();
                            }
                        });
                    }
                }
        });
     }

     function Save() {
         var aid = @ViewBag.ARID;

         var name = $('#ArchiveTree_ArchiveFields_txtName').val();
         var type = $('#ArchiveTree_ArchiveFields_cmbType').combobox('getValue');
         var wordid = $('#ArchiveTree_ArchiveFields_cmbWordType').combobox('getValue');
         if (type != '@ViewBag.Text30')
             wordid = 0;
         var show = $('#ArchiveTree_ArchiveFields_cmbShow').combobox('getValue');
         var query = $('#ArchiveTree_ArchiveFields_cmbQuery').combobox('getValue');
         var edit = $('#ArchiveTree_ArchiveFields_cmbEdit').combobox('getValue');
         var stat = $('#ArchiveTree_ArchiveFields_cmbStat').combobox('getValue');
         var isnull = $('#ArchiveTree_ArchiveFields_cmbNull').combobox('getValue');
         var len = $('#ArchiveTree_ArchiveFields_txtLen').val();
         var order = $('#ArchiveTree_ArchiveFields_txtOrder').val();
         if (!Vaild())
             return;
          $.ajax({
                url: "/ArchvieTree/Save_ajaxArchiveFields",
                dataType: "text",
                type: "post",
                data: { aid: aid, name: name, type: type, wordid: wordid, show: show, query: query, edit: edit, stat: stat, isnull: isnull, len: len, order: order, id:0},
                success: function (data) {
                    if (data == -1)
                        $.messager.alert('@ViewBag.Text21', '@ViewBag.Text24', 'error');
                    else if (data == 0)
                        $.messager.alert('@ViewBag.Text21', '@ViewBag.Text27', 'error');
                    else {
                        $.messager.alert('@ViewBag.Text21', '@ViewBag.Text219', 'info');
                        $('#ArchiveTree_ArchiveFields_grid').datagrid({
                            url: '/ArchvieTree/Get_ajaxArchiveFields?arid=' + aid,
                            singleSelect: true,
                            method: 'post',
                            onLoadSuccess: function (data) {
                                $('.pagination-page-list').hide();
                            }
                        });
                    }
                }
        });
     }
</script>
